# Disable all warnings in this notebook to improve readability.
import warnings
warnings.simplefilter("ignore")
Goal of this project is to develop a ML-based model that can reliably perform the predictions based on publicly available data input.
The model is not trained again before the input of future data and shall therefore be generalizable.
Quality indicator of the prediction is quantity-weighted RSME.
First step was a brainstorming about the possible influence factors without specifying potential data sources and required formats. Afterwards we clustered the factors into a mind-map.
The main factor categories we identified are:
Besides data related to Germany, the influence factors can always be extended to neighboring countries, this means that most of the identified factors exist for every other country and could thus be used as further input for training our model.
However, our main independent variables are related to Germany, improved by weather data from neighboring countries.


%%html
<style>
table {margin-left: 0 !important;}
</style>
Only publicly availabe data:
| Extracted Data | Source |
|---|---|
| Net Electricity Flow | SMARD, xyz |
| Production forecast | SMARD, xyz |
| Consumption forecast | SMARD, xyz |
| Realized Prodcution | SMARD, xyz |
| Realized consumption | SMARD, xyz |
| Price Data | SMARD, xyz |
| Weather | DWD, DMI, LFBD, LKPR |
Rest?
We built a scraper for the German and Danish weather data (DWD, DMI)
Abbreviations:
DWD (German Meteorological Institute)
DMI (Danish Meteorological Institute)
LFBD (Airport Bordeaux)
LKPR (Airport Prague)
Oft ist es gut, wenn am Ende eines Kapitels, bzw. vor dem Anfang des nächsten Kapitels noch ein Absatz steht, der alles zusammenfasst. Bei 10 Minuten egal? Was meint ihr?
@TODO Korrelationsplots von Hendrik
from bda_prophet import bda_prophet
from fbprophet import Prophet
#from fbprophet.plot import plot_plotly
#import plotly.offline as py
country_codes = bda_prophet.extract_country_codes(df)
df = bda_prophet.get_net_export(df, country_codes, ["EX","IM"])
df.head()
df_NX = df[['Date', 'NX']]
df_NX = bda_prophet.rename_columns_for_prophet(df_NX)
df_NX.head()
m = Prophet()
m.fit(df_NX)
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) <ipython-input-9-550ddd5a9981> in <module>() ----> 1 from bda_prophet import bda_prophet 2 from fbprophet import Prophet 3 4 #from fbprophet.plot import plot_plotly 5 #import plotly.offline as py ~\Documents\GitHub\BDA-Presentation\bda_prophet\bda_prophet.py in <module>() 6 from datetime import timedelta 7 from datetime import datetime ----> 8 from fbprophet import Prophet 9 10 def extract_country_codes(df): ModuleNotFoundError: No module named 'fbprophet'
A decomposition of linear components with Facebook's Prophet creates additional insights.
import pandas as pd
from datetime import datetime
future = pd.DataFrame({"ds": pd.date_range(start=datetime(2018,5,1), end=datetime(2019,5,31,23,0,0))})
forecast = m.predict(future)
fig2 = m.plot_components(forecast)
Zeigen, wie wir auf den Masterdataframe gekommen sind.
Erklären wie das finale Modell funktioniert, Input, Output, Funktionsweise ...
Was haben wir gelernt, wo ist Verbesserungpotential.